
const { SerialPort } = require('serialport')
const M=require("ming_node");
let bc= require("./BinConvert.js")
sp = new SerialPort({ path: "COM10", baudRate: 115200 });

async function dvbTest(){
    sp.write(bc.hexStr2Bytes("02 57 00 30 00 00 01 00 00 03"))
   // await M.delayMs(10)
    sp.write(bc.hexStr2Bytes("02 57 01 20 00 00 02 00 00 03 "))
   // await M.delayMs(10)
    sp.write(bc.hexStr2Bytes("02 57 02 B0 00 00 03 00 00 03 "))
   // await M.delayMs(10)
    sp.write(bc.hexStr2Bytes("02 57 03 20 00 00 04 00 00 03 "))
  //  await M.delayMs(10)
    sp.write(bc.hexStr2Bytes("02 57 04 00 00 00 03 00 00 03 "))
 //   await M.delayMs(10)
    sp.write(bc.hexStr2Bytes("02 52 10 00 00 00 00 00 00 03"))
}
async function iconTest(){

   // sp.write(bc.hexStr2Bytes("02 57 04 00 00 00 03 00 00 03 "))
   // await M.delayMs(1)
   // sp.write(bc.hexStr2Bytes("02 57 04 00 00 02 00 00 00 03 "))
}


async function main(){
    await dvbTest();
  // await iconTest();
}

main()